package megadrum.mididata;

import javax.sound.midi.*;
import java.util.Vector;

public class MultiReceiver implements Receiver {

    private Vector<Receiver> list;

    public MultiReceiver() {
        list = new Vector<Receiver>();
    }

    public void add(Receiver r) {
        list.add(r);
    }

    public void remove(Receiver r) {
        list.remove(r);
    }

    public void send(MidiMessage event, long time) {
        for (int i = 0; i < list.size(); i++) {
            list.get(i).send(event, time);
        }
    }

    public void close() {
    }
    private MultiReceiver parent = this;
}
